<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript"> //动态创建表格行与文本框
   function addRow() {
	var myTab=document.getElementById("tab"); //获取表格对象
	var newRow=myTab.insertRow(myTab.rows.length-1); //创建表格行
         //为新增的表格动态生成文本框
    	newRow.insertCell(0).innerHTML="选择文件：<input type='file' name='upload'/>";
      }
</script>
</head>
<body>
    <s:fielderror/>
    <form action="ups.action" method="post" enctype="multipart/form-data">
        <table id="tab">        
            <tr><td>选择文件：<input type="file" name="upload"></td> </tr>
            <tr>
                <td>
                    <input value="上传" type="submit">
                    <input type="button" value="添加一个上传文件" onclick="addRow()">    
                </td>
            </tr>
        </table>
    </form>
</body>
</html>